import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86185
 * Date: 2023-10-23
 * Time: 18:15
 */
public class Exam1023 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String string1 = scanner.next();
        String string2 = scanner.next();
        int maxLen = 0;
        int fast = 0;
        int low = 0;
        while (true) {

        }
    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            int count = 0;
            if(n == 0) {
                break;
            }
            while (n / 3 != 0) {
                count += n / 3;
                int add = n / 3;
                n = add + n % 3;
            }
            if(n == 2) {
                ++count;
            }
            System.out.println(count);
        }
    }
}
